
  <div class="am-tabs am-margin" data-am-tabs>
    <ul class="am-tabs-nav am-nav am-nav-tabs">
      <li class="am-active"><a href="#tab1">填写信息</a></li>
    </ul>
    <div class="am-tabs-bd">
      <div class="am-tab-panel am-fade am-in am-active" id="tab1">
      	<!--{foreach ( $view_fields as $key=>$val )}-->
      		<!--{if ($val['type'] == 'select')}-->
		        <div class="am-g am-margin-top">
		          <div class="am-u-sm-4 am-u-md-2 am-text-right"><!--{$val['name']}--></div>
		          <div class="am-u-sm-8 am-u-md-10">
		            <select data-am-selected="{btnSize: 'xs',maxHeight: 150,btnStyle: 'secondary'}" name="<!--{$key}-->">
		              <!--{foreach($select_fields[$key] as $k=>$v )}-->		
		              <option value="<!--{$k}-->" ><!--{$v}--></option>
		              <!--{/foreach}-->
		            </select>
		          </div>
		        </div>
		    <!--{elseif ($val['type'] == 'treelist')}--> 
			    <div class="am-g am-margin-top">
			      <div class="am-u-sm-4 am-u-md-2 am-text-right"><!--{$val['name']}--></div>
			      <div class="am-u-sm-8 am-u-md-10">
			        <select data-am-selected="{btnSize: 'xs',maxHeight: 200,btnStyle: 'success'}" name="<!--{$key}-->">
			       		<!--{$treelist_fields[$key]}-->
			        </select>
			      </div>
			    </div>
			<!--{elseif ($val['type'] == 'text')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" class="am-input-sm" name="<!--{$key}-->" >
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>
			<!--{elseif ($val['type'] == 'autoinput')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text"  name="<!--{$key}-->"  autocomplete="off">
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>
	          <script type="text/javascript">

				$("input").autopoint({url:'<!--{$val['dataurl']}-->',submit:["action1", "action2"]});
	          </script>
			<!--{elseif ($val['type'] == 'datetime')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" class="am-input-sm" name="<!--{$key}-->"  id="<!--{$key}-->">
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>

          <script>
	            var <!--{$key}--> = {
	                elem: '#<!--{$key}-->',
	                format: 'YYYY/MM/DD hh:mm:ss',
	                istime: true
	            };
	            laydate(<!--{$key}-->);

          </script>
			<!--{elseif ($val['type'] == 'textarea')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">

	            	<textarea name="<!--{$key}-->"  id="<!--{$key}-->"></textarea>
	  
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>
			<!--{elseif ($val['type'] == 'password')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="password" class="am-input-sm" name="<!--{$key}-->" >
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>
			<!--{elseif ($val['type'] == 'tag')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-6">
	            	<div data-tags-input-name="<!--{$key}-->" id="<!--{$key}-->Box"></div>
	            </div>
	            <div class="am-hide-sm-only am-u-md-4"><!--{$val['note']}--></div>
	          </div>
			  <script>
				$(function() {
				   		$("#<!--{$key}-->Box").tagging();
				});
			  </script>
			<!--{elseif ($val['type'] == 'richtext')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-10">
			        <script id="<!--{$key}-->" name="<!--{$key}-->" type="text/plain"></script>
	            </div>
	            
	          </div>
				<script type="text/javascript" src="./static/assets/js/ueditor/ueditor.config.js"></script>
		    	<!-- 编辑器源码文件 -->
			    <script type="text/javascript" src="./static/assets/js/ueditor/ueditor.all.js"></script>
			    <!-- 实例化编辑器 -->
			    <script type="text/javascript">
			        var editor = UE.getEditor('<!--{$key}-->');
			    </script>

			<!--{elseif ($val['type'] == 'image')}-->
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">
	              <!--{$val['name']}-->
	            </div>
	            <div class="am-u-sm-8 am-u-md-4">	              
		            <div class="am-form-group am-form-file">
					  <i class="am-icon-cloud-upload"></i> 选择要上传的图片
					  <input type="file" id="<!--{$key}-->_image" name="<!--{$key}-->_image" data-url="<!--{$val['uploadurl']}-->">
					  <input type="hidden" name="<!--{$key}-->">
					</div>
					<div id="image-list" style="display:none">
						<img src="" width="<!--{$val['width']}-->px" id="<!--{$key}-->_preview" />
					</div>
	            </div>
	            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	          </div>
			<script>
			$(function() {
			    $('#<!--{$key}-->_image').fileupload({
			        dataType: 'json',
			        formData:{filefield:'<!--{$key}-->_image'},
			        done: function (e, data) {
			          if(data.result.status == 0 ){
				          $("#<!--{$key}-->_preview").attr('src',data.result.data.url);
				          $(":input[name='<!--{$key}-->']").val(data.result.data.filename);
				          $("#image-list").show();
			          }else{
			          	alert(data.result.message);
			          }	
			        }    
			    });
			});
			</script>
			<!--{elseif ($val['type'] == 'file')}-->
				<div class="am-g am-margin-top">
		            <div class="am-u-sm-4 am-u-md-2 am-text-right">
		              <!--{$val['name']}-->
		            </div>
		            <div class="am-u-sm-8 am-u-md-4">	              
			            <div class="am-form-group am-form-file">
						  <i class="am-icon-cloud-upload"></i> 选择要上传的文件
						  <input type="file" id="<!--{$key}-->_file" name="<!--{$key}-->_file" data-url="<!--{$val['uploadurl']}-->">
						  <input type="hidden" name="<!--{$key}-->">
						</div>
						<div id="<!--{$key}-->_div" class="am-progress am-progress-striped am-progress-sm am-active " style="display:none">
						    <div id="<!--{$key}-->_bar" class="am-progress-bar am-progress-bar-secondary"  style="width: 0%;"></div>
						</div>
						<div id="<!--{$key}-->-list" style="display:none">
							<div id="<!--{$key}-->_name" /></div>
						</div>
		            </div>
		            <div class="am-hide-sm-only am-u-md-6"><!--{$val['note']}--></div>
	            </div>
            <script>
			$(function() {
			    $('#<!--{$key}-->_file').fileupload({
			        dataType: 'json',
			        formData:{filefield:'<!--{$key}-->_file'},
			        done: function (e, data) {
			          if(data.result.status == 0 ){
				          $("#<!--{$key}-->_name").html("上传成功");
				          $(":input[name='<!--{$key}-->']").val(data.result.data.filename);
				          $("#<!--{$key}-->-list").show();
			          }else{
			          	alert(data.result.message);
			          }	
			        },			        
                    progressall: function (e, data) {//设置上传进度事件的回调函数 
	                    var progress = parseInt(data.loaded / data.total * 100);  
	                    $('#<!--{$key}-->_div').css(
	                    	'display',
	                    	'block'
                    	);
	                    $('#<!--{$key}-->_bar').css(  
	                        'width',  
	                        progress + '%'  
	                    );  
	                }
			    });
			});
			</script>
			<!--{elseif ($val['type'] == 'checkbox')}-->
				<div class="am-g am-margin-top">
		          <div class="am-u-sm-4 am-u-md-2 am-text-right"><!--{$val['name']}--></div>
		          <div class="am-u-sm-8 am-u-md-10">
		            <div class="am-btn-group" data-am-button="">
		              <!--{foreach($checkbox_fields[$key] as $k=>$v )}-->		
	
		              <label class="am-btn am-btn-default am-btn-xs">
		                <input type="checkbox" name="<!--{$key}-->[]" value="<!--{$k}-->"><!--{$v}-->
		              </label>
		              <!--{/foreach}-->
		            </div>
		          </div>
		        </div>
			<!--{/if}--> 
        <!--{/foreach}-->
      </div>
    </div>
  </div>

  <div class="am-margin">
    <button type="submit" name="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
    <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="javascript:history.go(-1)">放弃保存</button>
  </div>
